﻿using UnityEngine;
using System.Collections;

public class FollowCharacter : MonoBehaviour {

	public GameObject character ;

	float lastPositionX ;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
		if ( lastPositionX != character.transform.position.x ) {
			transform.position= new Vector3( character.transform.position.x,
			                                 transform.position.y,
			                                 transform.position.z ) ;
			/*Vector3 mesCouilles= new Vector3( character.transform.position.x,
			                                  character.transform.position.y,
			                                  character.transform.position.z ) ;
			transform.LookAt(mesCouilles) ;*/

			lastPositionX= character.transform.position.x ;
		}
	}

}
